package com.nf.health.app.inquiry.impl.viewholder;

import android.app.Activity;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.nf.health.app.R;
import com.nf.health.app.customview.CircleImageView;
import com.nf.health.app.glide.GlideUtil;
import com.nf.health.app.inquiry.bean.DoctorDetailBean;
import com.nf.health.app.utils.GetToast;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Jason on 2016/9/28.
 * 付费咨询，详细信息 的 头布局
 */
public class DoctorPayDescriptViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
    @Bind(R.id.iv_head_icon_doc_pay)
    public CircleImageView iv_head_icon_doc_pay;

    @Bind(R.id.doctor_name_doc_pay)//医生姓名
    public TextView doctor_name_doc_pay;

   @Bind(R.id.doctorname_address_pay)//地址
    public TextView doctorname_address_pay;

    @Bind(R.id.doctor_job_doc_pay)
    TextView doctor_job_doc_pay;//医院名称
    ;
    @Bind(R.id.doctor_qianyue_pay)
    TextView doctor_qianyue_pay;//已签约用户


    private Activity cnt;
    public DoctorPayDescriptViewHolder(View itemView, Activity cnt) {
        super(itemView);
        ButterKnife.bind(this, itemView);
        this.cnt = cnt;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case  R.id.ll_shouqi_icon_doc:
            case  R.id.tv_query_doc_detail:
                GetToast.useString(cnt, "成功啦");

                break;
        }
    }

    public void loadData(DoctorDetailBean doctorDetail){
        if(doctorDetail == null){
            return ;
        }
        GlideUtil.loadNetImg2(cnt, iv_head_icon_doc_pay, doctorDetail.getDoctorhimg(), R.drawable.default_head);
        doctor_name_doc_pay.setText(TextUtils.isEmpty(doctorDetail.getDoctorname()) ? "未填写" : doctorDetail.getDoctorname());
        doctorname_address_pay.setText(TextUtils.isEmpty(doctorDetail.getHospitalname()) ? "未知地址" : doctorDetail.getHospitalname());//医院地址
        String doctortype =TextUtils.isEmpty(doctorDetail.getDepartment()) ? "位置类型" : doctorDetail.getProfessional();
        doctor_job_doc_pay.setText(TextUtils.isEmpty(doctorDetail.getDepartment()) ? "未填写" : doctorDetail.getDepartment()
        +" | "+doctortype);//专业（科室）
        doctor_qianyue_pay.setText("已签约"+
                (TextUtils.isEmpty(doctorDetail.getNum()) ? "0" : doctorDetail.getNum())+ "个家庭");
}
}
